package com.corpdata.common.api.activemq;

import javax.annotation.Resource;
import javax.jms.Destination;

import org.apache.activemq.command.ActiveMQQueue;
import org.springframework.jms.core.JmsMessagingTemplate;
import org.springframework.stereotype.Service;


/**
 * 生产者
 * @author zealon
 */
@Service
public class Producer {
	
	@Resource
	private JmsMessagingTemplate jmsMessagingTemplate;
	
	public void sendMsg(String destinationName,String msg){
		Destination destination = new ActiveMQQueue(destinationName);
		jmsMessagingTemplate.convertAndSend(destination, msg);
		
	}
}
